<!-- 搜索框组件 -->
<template>
  <div class="search-user">
    <el-input placeholder="按账号名，手机号，昵称搜索..." v-model="txt" size="medium">
      <template slot="prepend">输入搜索条件</template>
      <el-button slot="append" icon="el-icon-search" type="primary" @click="searchUser"></el-button>
    </el-input>
  </div>
</template>

<script>
// 导入混入对象（可以包含组件中声明的各个参数项）
import systemUser from "@/mixins/systemUser";
export default {
  mixins: [systemUser],
  data() {
    return {
      txt: "",
      searchData: []
    };
  },
  computed: {},
  methods: {
    searchUser() {
      console.log("搜索中");
      this.$http
        .searchUser({
          q: this.txt,
          status: this.getPager.currentStatus,
          page: this.getPager.currentPage,
          len: this.getPager.pageSize
        })
        .then(res => {
          console.log(res);
          if (res && res.data.code == 200) {
            this.setUserList(res.data.data);
            
          }
          // this.load()
        });
      this.txt = "";
    }
  }
};
</script>

<style scoped lang="less">
.search-user {
  width: 50%;
  margin-top: 5px;
  margin-bottom: 10px;
}
</style>
